{
  "properties" : { },
  "id" : "a74ccab5f84f4c9492475a29a88d257c",
  "script" : null,
  "groupId" : "ae84b87a26724813a446a132163ff3ca",
  "name" : "获取用户信息",
  "createTime" : null,
  "updateTime" : 1741367987239,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "getUserInfo",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ {
    "name" : "require_login",
    "value" : "false",
    "description" : "该接口需要登录才允许访问",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "requestBody" : "",
  "headers" : [ {
    "name" : "token",
    "value" : "9cee3797-4d10-455d-8cb5-e728063200c5",
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 200,\n    \"message\": \"success\",\n    \"data\": [\n        {\n            \"packageId\": 4,\n            \"packageName\": \"体验会员\",\n            \"startTime\": \"2025-03-02 18:24:49\",\n            \"endTime\": \"2099-12-31 23:59:59\"\n        }\n    ],\n    \"timestamp\": 1741365964130,\n    \"executeTime\": 8\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "200",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "success",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "null",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "timestamp",
      "value" : "1740910161678",
      "description" : "",
      "required" : false,
      "dataType" : "Long",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "executeTime",
      "value" : "9",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
//1、获取用户基础信息
import cn.dev33.satoken.stp.StpUtil
import log
var userId = StpUtil.getLoginId()
let result = db.select("""
        SELECT 
            s.package_id,
            p.package_name,
            s.start_time,
            s.end_Time
        FROM 
            subscription s
        LEFT JOIN 
            product_package p ON s.package_id = p.id
        WHERE 
            s.user_id = #{userId}
        ORDER BY s.id DESC, s.end_time DESC
        LIMIT 1
 """)

if (result != null && result.size() > 0) {
    return result[0]
}
// if (result != null && result.size() > 0) {
//     // for (item in result) {
//     //     if (item.packageId == 1) {
//     //         db.table("credit").columns("remain_count").where().eq("result", result).selectOne()
//     //     }
//     // }

//     if (result.size() = 1) {
//         return result
//     } else if (result.size() > 1) {


//     }
//     return result

// //2、获取订阅信息
// var subscr = {}
// var subscri = db.table("subscription").where().eq("user_id", userId).orderByDesc("end_time").select().limit(1)
// if (subscri != null) {
//     subscr = {
//         packageId: subscri.packageId,
//         startTime: subscri.startTime,
//         endTime: subscri.endTime,
//     }
// }
// //3、获取余额信息

// var credit = db.table("credit").where().eq("user_id", userId).orderByDesc("id").select().limit(1)
// if (credit != null) {


// }